home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / msdos622.rus / msdos_4.ddi / DRVBOOT.BAT < prev    next >
DOS Batch File  |  1993-05-31  |  3KB  |  129 lines

  1. @echo off
  2. rem Batch file to create a bootable, compressed floppy.
  3.  
  4. set _AM=XXX
  5. if not "%_AM%" == "XXX" goto env_error
  6.  
  7. set DCMD=12345678
  8. if not "%DCMD%" == "12345678" goto env_error
  9.  
  10. if "%1" == "/?" goto usage
  11. if not "%1" == "" goto start
  12.  
  13. :usage
  14. echo.
  15. echo Batch file to create a bootable, compressed floppy. For use only with 
  16. echo high density (1.44 and 1.2 megabyte) diskettes. Lower density diskettes
  17. echo when compressed do not have adequate uncompressed space for system files 
  18. echo required for booting.
  19. echo.
  20. echo Usage:  DRVBOOT drive:
  21. echo.
  22. goto end
  23.  
  24. :start
  25. echo.
  26. echo This batch file will create a bootable compressed diskette on either
  27. echo a 1.44 megabyte 3.5 inch or 1.2 megabyte 5.25 inch floppy. Lower density
  28. echo diskettes when compressed do not have adequate uncompressed space for system
  29. echo files and should not be used.
  30. choice /c:yn "Do you wish to continue "
  31. if errorlevel 2 goto end
  32.  
  33. for %%a in (A: a: B: b:) do if '%%a=='%1 goto diskette
  34. echo You have selected drive %1
  35. choice /c:yn "Is this correct "
  36. if errorlevel 2 goto end
  37.  
  38. :diskette
  39. am drvspace > NUL
  40. if errorlevel 2 goto version_error
  41. if errorlevel 1 SET DCMD=DRVSPACE
  42. am dblspace > NUL
  43. if errorlevel 1 SET DCMD=DBLSPACE
  44. if "%DCMD%" == "12345678" goto drvsp_error
  45. SET _AM=OFF
  46. am %1 > NUL
  47. if errorlevel 1 SET _AM=ON
  48. am %1 OFF > NUL
  49. if errorlevel 1 goto am_error
  50. choice /c:ny "Is diskette already compressed "
  51. if errorlevel 2 goto nocompress
  52. choice /c:yn "Do you wish to format the diskette first "
  53. if errorlevel 2 goto noformat
  54.  
  55. echo. > c:\drvboot.tmp
  56. echo n >> c:\drvboot.tmp
  57. echo Formatting drive %1...
  58. if not exist c:\drvboot.tmp goto no_temp
  59. format %1 /v:drvboot /u < c:\drvboot.tmp > NUL
  60. del c:\drvboot.tmp > nul
  61. goto noformat
  62. :no_temp
  63. format %1 /u /q
  64. if errorlevel 1 goto format_error
  65.  
  66. :noformat
  67. echo Compressing drive %1...
  68. %DCMD% /compress %1
  69. :nocompress
  70. %DCMD% /mount %1 > NUL
  71. %DCMD% /size /reserve=.2 %1
  72. copy c:\command.com %1
  73.  
  74. :mk_bootable
  75. %DCMD% /unmount %1 > NUL
  76.  
  77. :system
  78. sys %1
  79. rem Create ini file on diskette
  80. deltree /y %1\%DCMD%.ini > nul
  81. echo MaxRemovableDrives=2 > %1\%DCMD%.ini
  82. echo FirstDrive=E >> %1\%DCMD%.ini
  83. echo LastDrive=I >> %1\%DCMD%.ini
  84. echo MaxFileFragments=117 >> %1\%DCMD%.ini
  85. echo ActivateDrive=I,A0 >> %1\%DCMD%.ini
  86. attrib %1\%DCMD%.ini +s +h +r
  87.  
  88. if "%_AM%"=="ON" am %1 on
  89. choice /c:yn "Mount new compressed drive now "
  90. if errorlevel 2 goto end
  91. %DCMD% /mount %1
  92.  
  93. goto end
  94.  
  95. :format_error
  96. echo.
  97. echo An error occured while attemting to format the diskette in drive %1.
  98. echo Please retry with a new diskette.
  99. echo.
  100. goto end
  101.  
  102. :env_error
  103. echo.
  104. echo ERROR: Not enough environment space to run DRVBOOT.BAT!
  105. echo.
  106. goto end
  107.  
  108. :am_error
  109. echo.
  110. echo An error occured while disabling DriveSpace automount.
  111. echo.
  112. goto end
  113.  
  114. :drvsp_error
  115. echo.
  116. echo You need to have DriveSpace installed on your system
  117. echo to be able to make a compressed bootable floppy diskette.
  118. echo.
  119. goto end
  120.  
  121. :version_error
  122. echo.
  123. echo You need to have MS-DOS 6.20 or greater installed on your system
  124. echo to be able to make a compressed bootable floppy diskette.
  125. echo.
  126. :end
  127. SET _AM=
  128. SET DCMD=
  129.